
//猜硬币
#include <iostream>
#include <cmath>
using namespace std;

int main()
{
    int n = 0;
    while (cin >> n)
    {
        if (n == 0)
        {
            break;
        }
   
        int count = 0;
        while (n > 1)
        {
            ++count;
            if (n % 3 == 0)
                n /= 3;
            else 
                n = n / 3 + 1;
        }
        cout << count << endl;
    }
    return 0;
}